package org.example.day20240815;

import java.util.Scanner;

public class test4 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int num = scanner.nextInt();
        int result = 1;
        int sum=1;
        for(int i=2; i<=num; i++){
            sum+=(result*=i);
        }
        System.out.println(sum);
    }
}
